from django.db import models
from django.db.models import permalink

import capabilities.models

class Endorsement(models.Model):
    """
    Endorsement data
    """
    person = models.CharField(max_length=100)
    endorsement = models.TextField()
    slug = models.SlugField(unique=True)
    company = models.CharField(max_length=100)
    company_url = models.URLField()
    order = capabilities.models.OrderField()
    
    class Meta:
        ordering = ['order']
    
    def __unicode__(self):
        return self.person 
    
    @permalink
    def get_absolute_url(self):
        return ("endo_endorsement", [str(self.slug)])
